package com.xo.user.config;


import jakarta.annotation.Resource;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class FilterConfig {

    @Resource
    private TokenFilter tokenFilter;

    @Bean
    public FilterRegistrationBean commonFilterRegistration(){
        FilterRegistrationBean registration = new FilterRegistrationBean();
        registration.setFilter(tokenFilter);
        registration.addUrlPatterns("/mall/**", "/user/**");
        registration.setName("tokenFilter");
        registration.setOrder(1);
        return registration;
    }

}
